/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb.dao;

import entidades.Comision;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.Query;

/**
 *
 * @author paulo
 */
@Stateless
public class ComisionDAO extends GenericoJPADAO<Comision> implements ComisionDAOLocal {

    @Override
    public List<Comision> buscarTodos() {
        Query q = em.createQuery("SELECT object(c) FROM Comision AS c");
        return q.getResultList();
    }

    @Override
    public int contador() {
        Query q = em.createQuery("SELECT count(c) FROM Comision AS c");
        return (Integer) q.getSingleResult();
    }
}
